# -*- coding: utf-8 -*-
# Import Odoo models and fields
from odoo import models, fields, api, _


class PurchaseRequisition(models.Model):
    _inherit = 'purchase.requisition'

    s_forecast_order_id = fields.Many2one(
        's.forecast.order',
        string='Forecast Order',
        help="The forecast order that generated this purchase requisition."
    )


class PurchaseRequisitionLine(models.Model):
    _inherit = 'purchase.requisition.line'  # Inherit the existing purchase.requisition.line model

    s_forecast_material_summary_id = fields.Many2one(
        's.forecast.material.summary',
        string='Forecast Material Summary Line',
        help="The forecast material summary line that generated this requisition line."
    )
    # Optional: You could also add a related field to the forecast order for easier access
    s_forecast_order_id = fields.Many2one(
        related='requisition_id.s_forecast_order_id',
        string='Forecast Order',
        readonly=True,
        store=True
    )
